#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>

struct YContext
{
    GLFWwindow *window;
    int width;
    int height;

    YContext()
    {
        height = 0;
        width = 0;
        window = NULL;
    }
};

struct Box
{
    int width;
    int height;
    int vertices[24];
    unsigned int indices[18];

    unsigned int vao;
    unsigned int vbo;
    unsigned int ebo;
    unsigned int shader_program;

    Box()
    {
        width = 0;
        height = 0;
        glGenVertexArrays(1, &vao);
        glGenBuffers(1, &vbo);
        glGenBuffers(1, &ebo);
    }

    void build()
    {
        glBindVertexArray(vao);
        glBindBuffer(GL_ARRAY_BUFFER, vbo);
        glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_DYNAMIC_DRAW);
        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo);
        glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(vertices), indices, GL_DYNAMIC_DRAW);

        glBindVertexArray(0);
    }

    void draw()
    {
        glBindVertexArray(vao);
        glDrawElements(GL_QUADS, 6, GL_UNSIGNED_INT, 0);
    }
};
